/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Presentacion;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Maxi
 */
public class NuevoCliente extends javax.swing.JInternalFrame {

    ControlPresentacion controlLocal;
    
    public NuevoCliente(ControlPresentacion control) {
        initComponents();
        control=controlLocal;
        this.setVisible(true);
        setResizable(false);
        setTitle("Nuevo Cliente");
    }

      public NuevoCliente() {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
      }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
      // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
      private void initComponents() {

            jLabel1 = new javax.swing.JLabel();
            pnl_clienteNuevo = new javax.swing.JPanel();
            lbl_nombre = new javax.swing.JLabel();
            txt_nombre = new javax.swing.JTextField();
            lbl_dni = new javax.swing.JLabel();
            txt_dni = new javax.swing.JTextField();
            lbl_telefono = new javax.swing.JLabel();
            txt_telefono = new javax.swing.JTextField();
            lbl_email = new javax.swing.JLabel();
            txt_email = new javax.swing.JTextField();
            lbl_cuit = new javax.swing.JLabel();
            txt_cuit = new javax.swing.JTextField();
            lbl_domicilio = new javax.swing.JLabel();
            txt_domicilio = new javax.swing.JTextField();
            btn_aceptar = new javax.swing.JButton();
            btn_cancelar = new javax.swing.JButton();

            jLabel1.setText("Ingrese los datos del Cliente nuevo:");

            lbl_nombre.setText("Nombre y Apellido:");

            lbl_dni.setText("DNI:");

            lbl_telefono.setText("Telefono:");

            lbl_email.setText("E-mail:");

            lbl_cuit.setText("CUIT:");

            lbl_domicilio.setText("Domicilio:");

            javax.swing.GroupLayout pnl_clienteNuevoLayout = new javax.swing.GroupLayout(pnl_clienteNuevo);
            pnl_clienteNuevo.setLayout(pnl_clienteNuevoLayout);
            pnl_clienteNuevoLayout.setHorizontalGroup(
                  pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addGap(0, 395, Short.MAX_VALUE)
                  .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnl_clienteNuevoLayout.createSequentialGroup()
                              .addContainerGap()
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(lbl_nombre)
                                    .addComponent(lbl_dni)
                                    .addComponent(lbl_telefono)
                                    .addComponent(lbl_email)
                                    .addComponent(lbl_cuit)
                                    .addComponent(lbl_domicilio))
                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_telefono, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
                                    .addComponent(txt_nombre)
                                    .addComponent(txt_dni)
                                    .addComponent(txt_email)
                                    .addComponent(txt_cuit)
                                    .addComponent(txt_domicilio))
                              .addContainerGap()))
            );
            pnl_clienteNuevoLayout.setVerticalGroup(
                  pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addGap(0, 192, Short.MAX_VALUE)
                  .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnl_clienteNuevoLayout.createSequentialGroup()
                              .addContainerGap()
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(lbl_nombre)
                                    .addComponent(txt_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lbl_dni)
                                    .addComponent(txt_dni, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lbl_telefono)
                                    .addComponent(txt_telefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lbl_email))
                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(lbl_cuit)
                                    .addComponent(txt_cuit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                              .addGroup(pnl_clienteNuevoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(lbl_domicilio)
                                    .addComponent(txt_domicilio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                              .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            );

            btn_aceptar.setText("Aceptar");
            btn_aceptar.addActionListener(new java.awt.event.ActionListener() {
                  public void actionPerformed(java.awt.event.ActionEvent evt) {
                        btn_aceptarActionPerformed(evt);
                  }
            });

            btn_cancelar.setText("Cancelar");
            btn_cancelar.addActionListener(new java.awt.event.ActionListener() {
                  public void actionPerformed(java.awt.event.ActionEvent evt) {
                        btn_cancelarActionPerformed(evt);
                  }
            });

            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                              .addGroup(layout.createSequentialGroup()
                                    .addGap(114, 114, 114)
                                    .addComponent(btn_aceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(75, 75, 75)
                                    .addComponent(btn_cancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                              .addGroup(layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                          .addComponent(jLabel1)
                                          .addComponent(pnl_clienteNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addGroup(layout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(pnl_clienteNuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                              .addComponent(btn_aceptar)
                              .addComponent(btn_cancelar))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );

            pack();
      }// </editor-fold>//GEN-END:initComponents

    private void btn_cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_cancelarActionPerformed
        this.hide();
    }//GEN-LAST:event_btn_cancelarActionPerformed

      private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed
            // TODO add your handling code here:
            try {
                  try {
                        //cLocal.dameClientes();

                        controlLocal.crearCliente(123, "Maxi", null, null, null, null, null, null, null);
                  } catch (Exception ex) {
                        Logger.getLogger(NuevoCliente.class.getName()).log(Level.SEVERE, null, ex);
                  }
                this.dispose();
            } catch (NumberFormatException a){
      
      }//GEN-LAST:event_btn_aceptarActionPerformed
      }

      // Variables declaration - do not modify//GEN-BEGIN:variables
      private javax.swing.JButton btn_aceptar;
      private javax.swing.JButton btn_cancelar;
      private javax.swing.JLabel jLabel1;
      private javax.swing.JLabel lbl_cuit;
      private javax.swing.JLabel lbl_dni;
      private javax.swing.JLabel lbl_domicilio;
      private javax.swing.JLabel lbl_email;
      private javax.swing.JLabel lbl_nombre;
      private javax.swing.JLabel lbl_telefono;
      private javax.swing.JPanel pnl_clienteNuevo;
      private javax.swing.JTextField txt_cuit;
      private javax.swing.JTextField txt_dni;
      private javax.swing.JTextField txt_domicilio;
      private javax.swing.JTextField txt_email;
      private javax.swing.JTextField txt_nombre;
      private javax.swing.JTextField txt_telefono;
      // End of variables declaration//GEN-END:variables
}
